import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Table';
import { useUserStore } from '@/store/modules/user';

const userStore = useUserStore();
import { useI18n } from '@/hooks/web/useI18n';

const { t } = useI18n();
export const columns: BasicColumn[] = [
  {
    title: t('主键'),
    align: 'center',
    dataIndex: 'id',
  },
  {
    title: t('名称'),
    align: 'center',
    dataIndex: 'name',
  },
  {
    title: t('编码'),
    align: 'center',
    dataIndex: 'code',
  },
  {
    title: t('排序'),
    align: 'center',
    dataIndex: 'sort',
  },
  {
    title: t('备注'),
    align: 'center',
    dataIndex: 'remark',
  },
  {
    title: t('创建时间'),
    align: 'center',
    dataIndex: 'createTime',
  },
  {
    title: t('创建用户'),
    align: 'center',
    dataIndex: 'createUser',
  },
  {
    title: t('更新时间'),
    align: 'center',
    dataIndex: 'updateTime',
  },
  {
    title: t('修改用户'),
    align: 'center',
    dataIndex: 'updateUser',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: t('名称'),
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'code',
    label: t('编码'),
    component: 'Input',
    colProps: { span: 8 },
  },
];
export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '',
    component: 'Input',
    show: false,
  },
  {
    field: 'name',
    label: t('名称'),
    component: 'Input',
    required: true,
  },
  {
    field: 'code',
    label: t('编码'),
    component: 'Input',
    required: true,
  },
  {
    field: 'sort',
    label: t('排序'),
    component: 'InputNumber',
    required: true,
  },
  {
    field: 'remark',
    label: t('备注'),
    component: 'Input',
    required: true,
  },
];
